package com.yingjie.ic;

import java.io.IOException;  
import java.io.InputStream;  
import java.net.HttpURLConnection;  
import java.net.MalformedURLException;  
import java.net.URL;  
  
import android.graphics.Bitmap;  
import android.graphics.BitmapFactory;  
  
public class BitmapHelper {  
    public static Bitmap getBitmap(String imageUrl) {  
        Bitmap mBitmap = null;  
        try {  
            URL url = new URL(imageUrl);  
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();  
            InputStream is = conn.getInputStream();  
            mBitmap = BitmapFactory.decodeStream(is);  
  
        } catch (MalformedURLException e) {  
            e.printStackTrace();  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
  
        return mBitmap;  
    }  
  
}  